<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('志愿者顾问信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>顾问编号：</p>
                                <input type="text" name="adviserCode"/>
                            </li>
                            <li>
                                <p>顾问姓名：</p>
                                <input type="text" name="adviserName"/>
                            </li>
                            <li>
                                <p>顾问职务：</p>
                                <input type="text" name="adviserJob"/>
                            </li>
                            <li>
                                <p>顾问职称：</p>
                                <input type="text" name="adviserTitle"/>
                            </li>
                            <li class="select-time">
                                <p>顾问生日：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginAdviserBirthday]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endAdviserBirthday]"/>
                            </li>
                            <li>
                                <p>单位名称：</p>
                                <input type="text" name="workplaceName"/>
                            </li>
                            <li>
                                <p>顾问学历：</p>
                                <input type="text" name="adviserDegree"/>
                            </li>
                            <li>
                                <p>所在地：</p>
                                <input type="text" name="volunteerArea"/>
                            </li>
                            <li>
                                <p>所在地ID：</p>
                                <input type="text" name="volunteerAreaid"/>
                            </li>
                            <li>
                                <p>状态：</p>
                                <input type="text" name="memberState"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="vtsp:adviser:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="vtsp:adviser:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="vtsp:adviser:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="vtsp:adviser:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table">
                    <thead>
                        <tr>
                            <th data-checkbox="true"></th>
                            <th data-formatter="fm_rowIndex" data-align="center">序号</th>
                            <th data-field="adviserCode">顾问编号</th>
                            <th data-field="adviserName">顾问姓名</th>
                            <th data-field="adviserJob">顾问职务</th>
                            <th data-field="adviserTitle">顾问职称</th>
                            <th data-field="adviserBirthday">顾问生日</th>
                            <th data-field="workplaceName">单位名称</th>
                            <th data-field="adviserDegree">顾问学历</th>
                            <th data-field="volunteerArea">所在地</th>
                            <th data-field="volunteerAreaid">所在地ID</th>
                            <th data-field="memberState">状态</th>
                            <th data-field="memo">备注</th>
                            <th data-formatter="fm_commands" data-width="120px" data-align="center">操作</th> 
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('vtsp:adviser:edit')}]];
        var removeFlag = [[${@permission.hasPermi('vtsp:adviser:remove')}]];
        var prefix = ctx + "vtsp/adviser";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "志愿者顾问信息",
                uniqueId: "adviserId"            
            };
            $.table.init(options);
        });
        
        //命令  
        function fm_commands(value, row, index){
            var actions = [];
            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.adviserId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.adviserId + '\')"><i class="fa fa-remove"></i>删除</a>');
            return actions.join('');
        }
    </script>
</body>
</html>